<main>
  <div class="isolate overflow-hidden">
    <div class="flow-root bg-gray-900 pb-16 pt-24 sm:pt-28 lg:pb-0">
      <div x-data="{annual: true}" class="mx-auto max-w-7xl px-6 lg:px-8">
        <div class="relative z-10">
          <h2 class="mx-auto max-w-4xl text-center text-5xl font-bold tracking-tight text-white">A price for everyone.</h2>
          <p class="mx-auto mt-4 max-w-2xl text-center text-lg leading-8 text-white/60">We made a plan for each one of you. No-brainer for quick exploration, independent usage or even team. Tailor-made for you when needed.</p>
          <div class="mt-16 flex justify-center">
            <fieldset aria-label="Payment frequency">
              <div class="grid grid-cols-2 gap-x-1 rounded-full bg-white/5 p-1 text-center text-xs font-semibold leading-5 text-white">
                <label @click="annual = false" :class="{'bg-indigo-500': !annual}" class="cursor-pointer rounded-full px-2.5 py-1">
                  <input type="radio" name="frequency" value="monthly" class="sr-only">
                  <span>Monthly</span>
                </label>
                <label @click="annual = true" :class="{'bg-indigo-500': annual}" class="cursor-pointer rounded-full px-2.5 py-1">
                  <input type="radio" name="frequency" value="yearly" class="sr-only">
                  <span>Yearly</span>
                </label>
              </div>
            </fieldset>
          </div>
        </div>
        <div class="relative mx-auto mt-10 grid max-w-md grid-cols-1 gap-y-8 lg:mx-0 lg:-mb-14 lg:max-w-none lg:grid-cols-4">
          <svg viewBox="0 0 1208 1024" aria-hidden="true" class="absolute -bottom-48 left-1/2 h-[64rem] -translate-x-1/2 translate-y-1/2 [mask-image:radial-gradient(closest-side,white,transparent)] lg:-top-48 lg:bottom-auto lg:translate-y-0">
            <ellipse cx="604" cy="512" fill="url(#d25c25d4-6d43-4bf9-b9ac-1842a30a4867)" rx="604" ry="512" />
            <defs>
              <radialGradient id="d25c25d4-6d43-4bf9-b9ac-1842a30a4867">
                <stop stop-color="#7775D6" />
                <stop offset="1" stop-color="#E935C1" />
              </radialGradient>
            </defs>
          </svg>
          <div class="hidden lg:absolute lg:inset-x-px lg:bottom-0 lg:top-4 lg:block lg:rounded-t-2xl lg:bg-gray-800/80 lg:ring-1 lg:ring-white/10" aria-hidden="true"></div>
          <%= render AzimuttWeb.PartialsView, "_pricing_plan_dark.html", plan: Azimutt.plans.free, cta: "Explore your db", sub: fn _, _ -> Routes.elm_path(@conn, :new) end %>
          <%= render AzimuttWeb.PartialsView, "_pricing_plan_dark.html", plan: Azimutt.plans.solo, cta: "Start free trial", sub: fn plan, freq -> Routes.subscribe_path(@conn, :price, plan, freq) end %>
          <%= render AzimuttWeb.PartialsView, "_pricing_plan_light.html", plan: Azimutt.plans.team, cta: "Start free trial", sub: fn plan, freq -> Routes.subscribe_path(@conn, :price, plan, freq) end %>
          <%= render AzimuttWeb.PartialsView, "_pricing_plan_dark.html", plan: Azimutt.plans.enterprise, cta: "Contact us", sub: fn _, _ -> "mailto:#{Azimutt.config(:support_email)}" end %>
        </div>
      </div>
    </div>
    <div class="relative bg-gray-50 lg:pt-14">
      <div class="mx-auto max-w-7xl px-6 py-24 sm:py-32 lg:px-8">
        <% feature_categories = [%{name: "Database features", features: [
          Azimutt.features().schema_exploration,
          Azimutt.features().data_exploration,
          Azimutt.features().aml,
          Azimutt.features().colors,
          Azimutt.features().schema_export,
          Azimutt.features().ai,
          Azimutt.features().analysis,
          Azimutt.features().project_export,
        ]}, %{name: "Product quotas", features: [
          Azimutt.features().users,
          Azimutt.features().projects,
          Azimutt.features().project_dbs,
          Azimutt.features().project_layouts,
          Azimutt.features().layout_tables,
          Azimutt.features().project_doc,
        ]}, %{name: "Extended integration", features: [
          Azimutt.features().project_share,
          Azimutt.features().api,
          Azimutt.features().sso,
          Azimutt.features().user_rights,
          Azimutt.features().gateway_custom,
          Azimutt.features().billing,
          Azimutt.features().support_on_premise,
          Azimutt.features().support_enterprise,
          Azimutt.features().consulting,
          Azimutt.features().roadmap,
        ]}] %>
        <%= render AzimuttWeb.PartialsView, "_pricing_features_mobile.html", plans: Azimutt.active_plans, feature_categories: feature_categories, selected: :team %>
        <%= render AzimuttWeb.PartialsView, "_pricing_features_desktop.html", plans: Azimutt.active_plans, feature_categories: feature_categories, selected: :team %>
      </div>
    </div>
  </div>
  <%= render AzimuttWeb.PartialsView, "_faq.html", title: "Frequently asked questions", questions: [
    %{question: "Which databases are supported?", answer: "Azimutt is not tied to a specific database. If they can fit in an entity-relationship model, it's great for Azimutt. Still, some have full-support and other will need more work to integrate. Most common ones like PostgreSQL, MySQL, SQL Server, MongoDB, Couchbase, Snowflake, BigQuery and more are supported using database connection, you only need to provide your connection url. Any SQL schema is supported as well, so PostgreSQL, MySQL, MariaDB, Oracle, SQL Server and others very easy to integrate. For the others, you need to extract their schema and format it as JSON to load it into Azimutt. The CLI has a JSON schema inference to help with this if you need. Don't hesitate to reach out for any help with this 😉"},
    %{question: "What about data privacy?", answer: "We take data privacy very seriously and offer several ways around it. The code is Open Source, you can freely audit it to see what we do with your data (ie: nothing!). You can choose to share your database connection or just import the schema of the tables you want. Parsing the schema is done in browser, you can choose to keep your project local so Azimutt servers will never see your data. And finally, you can host yourself an Azimutt instance."},
  ] %>
</main>

<%= render "_footer.html", conn: @conn %>
